<template>
  <div class="h1">
    <div class="l1">
      <span v-if="pathname=='item'" class="page-header-back" @click="goback"></span>
    </div>
    <div class="mao"><slot></slot></div>
    <div class="r1" >
      <img
        src="//p0.meituan.net/scarlett/f05f61e7a8f3f45fd071c068d7a26870356.png"
        alt="" v-if="pathname!=='item'"
      />
    </div>
  </div>
</template>

<script>
export default {
  name: "header1",
  data:function(){
    return{
      pathname:""
    }
  },
  mounted () {
    this.pathname = this.$route.name
  },
  methods:{
    goback(){
      this.$router.go(-1)
    }
  }
    
};
</script>

<style scoped>
.h1 {
  height: 50.5px;
  color: white;
  font-size: 18px;
  background: #e54247;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: center;
}

.h1 > .mao {
  flex: 1;
}
.h1 > .r1,
.l1 {
  width: 52.5px;
  height: 100%;
}
.h1 > .r1 {
  text-align: right;
  line-height: 50.5px;
}

.h1 > .r1 > img {
  height: 17px;
  width: 16px;
  margin-right: 12px;
}
.h-con {
  height: 60px;
  padding: 10px;
  border-bottom: 1px solid #e8e8e8;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.l1{
  position: relative;
}
.page-header-back:before{
  width: 15px;height: 15px;
  content: "";
  position: absolute;
  border-left: 2px solid white;
   border-bottom: 2px solid white;
   transform: rotate(45deg);
   top: 15px;left: 20px;
}
</style>
